10.3 查询角色列表
基本信息
Path:/api/v1/role/queryAll
Method: GET
接口描述:
请求参数
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| filter | 非必须 | name | 过滤条件,只能从 ['all', 'name', 'description', 'userName']中选择。不传或者传空表示不添加过滤条件,即查询全部。 |
| searchValue | 非必须 | test | 搜索关键字,不传或者传空表示不添加过滤条件,即查询全部 |
| pageSize | 非必须 | 20 | 分页大小,默认20 |
| pageIndex | 非必须 | 1 | 当前页码,从1开始 |
| sortBy | 非必须 | 排序字段 | |
| asc | 非必须 | 排序方式,1升序,0降序,默认升序 | |
| isPage | 非必须 | '0'不需要分页,'1' 需要分页 |
请求示例
filter=all&searchValue=2&pageSize=20&pageIndex=1
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| code | string | 必须 | 错误码 | 示例: 0 | |
| data | object | 必须 | 返回数据 | ||
| ├─ count | number | 必须 | 角色总数 | ||
| ├─ pageCount | number | 必须 | 总页数 | ||
| ├─ pageSize | string | 必须 | 分页大小 | ||
| ├─ pageIndex | string | 必须 | 页码 | ||
| ├─ data | object[] | 必须 | 角色列表 | ||
| ├─├─ id | string | 必须 | 角色id | ||
| ├─├─ name | string | 必须 | 角色名称 | ||
| ├─├─ status | number | 必须 | 启用状态,0禁用,1启用 | ||
| ├─├─ description | string | 必须 | 描述 | ||
| ├─├─ localUserList | string | 非必须 | 关联的本地用户列表 | ||
| ├─├─├─ id | string | 非必须 | 用户ID | ||
| ├─├─├─ name | string | 非必须 | 用户名称 | ||
| ├─├─├─ description | string | 非必须 | 描述 | ||
| ├─├─ resourceList | string | 非必须 | 关联的应用列表 | ||
| ├─├─├─ id | string | 非必须 | 应用ID | ||
| ├─├─├─ name | string | 非必须 | 应用名称 | ||
| ├─├─├─ description | string | 非必须 | 描述 | ||
| ├─├─├─ dataType | string | 非必须 | 数据类型,resource应用,group应用分类 | ||
| msg | string | 必须 | 错误消息 | 示例: 成功 |
返回示例
{
"code": 0,
"data": {
"pageSize": 20,
"pageIndex": 1,
"count": 1,
"pageCount": 1,
"data": [{
"id": "822a63d0-5b8b-11eb-ab31-83fd8f2a64ca",
"name": "新角色1",
"status": 1,
"description": "这是新角色"
}]
},
"msg": "请求成功"
}
错误信息
| 错误提示 | 错误码 |
|---|---|
| 参数检查出错 | 10000001 |